﻿using System.Windows;
using System.Windows.Input;

namespace Lottery.Client.SL.Controls
{
    public partial class Alert
    {
        public Alert()
        {
            InitializeComponent();
            base.KeyUp += KeyUp_Handler;
        }
        private void KeyUp_Handler(object obj, KeyEventArgs keyEventArgs)
        {
            if (keyEventArgs.Key == Key.Escape)
            {
                base.DialogResult = new bool?(false);
            }
        }
        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
            base.DialogResult = new bool?(true);
        }
        public void ShowMessage(string msg)
        {
            this.ShowMessage(msg, "系统信息");
        }
        public void ShowMessage(string msg, string title)
        {
            base.Title = title;
            this.tbMsg.Text = msg;
            base.Show();
        }
    }
}
